<?php

/**
 * This is the model metadata class for table "information".
 */
class InformationMetadata extends CARMDC
{
	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'information';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('cate_id, uid, is_recommend, is_top', 'numerical', 'integerOnly'=>true),
			array('title', 'length', 'max'=>50),
			array('content, create_time', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, title, content, cate_id, uid, create_time, is_recommend, is_top', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'title' => '标题',
			'content' => '内容',
			'cate_id' => '分类id',
			'uid' => '用户',
			'create_time' => '创建时间',
			'is_recommend' => '是否推荐',
			'is_top' => '是否置顶',
		);
	}
}